import React, { Component } from 'react'
import LifeTest from './components/LifeTest'

/* 
*/
export default class App extends Component {

  state = {
    count: 1
  }

  render() {
    const {count} = this.state

    return (
      <div>
        <h1>App组件</h1>
        <p>state.count: {count}</p>
        <button onClick={() => this.setState({count: count+1})}>增加count</button>
        <button onClick={() => this.setState({count: count-1})}>减少count</button>

        {count<5 && <LifeTest count={count}></LifeTest>}
      </div>
    )
  }
}
